package main

import (
	"bufio"
	"os"
)

func main() {
	m := bufio.NewScanner(os.Stdin)
	n := bufio.NewScanner(os.Stdin)
	m.Scan()
	n.Scan()
	s := m.Text()
	j := n.Text()
	println(combine(s, j))
}

func combine(n int, k int) [][]int {
	var ans [][]int

	var dfs func(int, []int)
	dfs = func(m int, path []int) {
		if len(path) == k {
			tmp := make([]int, k)
			copy(tmp, path)
			ans = append(ans, tmp)
			return
		}
		if m > n {
			return
		}

		dfs(m+1, append(path, m))
		dfs(m+1, path)
		return
	}

	dfs(1, []int{})
	return ans
}
